<template>
  <view class="page_edu">
    <view class="page_edu_header">
      <view class="header">
        <clLcons type="icon-chanpinshezhi" color="#fff" size="25"></clLcons>
        <view class="input">
          <clLcons
            class="m-r-10 m-l-10"
            type="icon-sousuo_o"
            color="#666"
            size="25"
          ></clLcons>
          <input type="text" value="" placeholder="搜索" />
        </view>
        <clLcons type="icon-shezhi" color="#fff" size="25"></clLcons>
      </view>
      <view class="header_content">
        <view class="left">
          <div class="sub_title">
            今日销售额
            <clLcons
              class="m-r-10 m-l-10"
              type="icon-yanjing_xianshi"
              color="#fff"
              size="25"
            ></clLcons>
            <clLcons
              class="m-r-10 m-l-10"
              type="icon-shuaxin"
              color="#fff"
              size="15"
            ></clLcons>
          </div>
          <text class="title">1880</text>
        </view>
      </view>
      <view class="header_content m-t-p-15">
        <view class="left">
          <div class="sub_title">今日销量</div>
          <text class="title">18</text>
        </view>
        <view class="left">
          <div class="sub_title">今日收款金额</div>
          <text class="title">4888</text>
        </view>
        <view class="left">
          <div class="sub_title">今日进货数量</div>
          <text class="title">98</text>
        </view>
      </view>
    </view>
    <view class="page_content">
      <view class="menu">
        <template v-for="(it, i) in menus">
          <view class="item" :key="'menu_' + i" @click="details(it)">
            <view class="img_view" :style="{ background: it.bg }">
              <clLcons
			  @click="details(it)"	
                class="m-r-10 m-l-10"
                :type="it.icon"
                color="#fff"
                size="30"
              ></clLcons>
            </view>
            <text class="txt">{{ it.txt }}</text>
          </view>
        </template>
      </view>
    </view>
	<u-toast ref="uToast"></u-toast>
  </view>
</template>

<script>
import clLcons from "@/components/cl-icon/cl-icon.vue";
export default {
  data() {
    return {
      menus: [
        {
          bg: "linear-gradient(0deg,rgba(9,216,162,1),rgba(90,242,217,1))",
          icon: "icon-zongshu",
          txt: "采购单",
          route:
            "/pages/application/pages/personnel/supplier/supplier?type=cgd&page=cgd",
          isFree: true,
        },
        {
          bg: "linear-gradient(0deg,rgba(251,184,35,1),rgba(255,228,40,1))",
          icon: "icon-renwuguanli",
          txt: "客户订单",
          isFree: false,
          route:
            "/pages/application/pages/cloth/sales-ticket/index?type=khdd&page=khdd",
        },
        {
          bg: "linear-gradient(0deg,rgba(255,126,34,1),rgba(240,184,27,1))",
          icon: "icon-kechengzhongxin",
          txt: "销售单",
          isFree: true,
          route:
            "/pages/application/pages/cloth/sales-ticket/index?type=xsd&page=xsd",
        },
        {
          bg: "linear-gradient(0deg,rgba(9,177,252,1),rgba(24,200,255,1))",
          icon: "icon-tuihuodan",
          txt: "库存查询",
          isFree: true,
        },
      ],
    };
  },
  components: {
    clLcons,
  },
  onLoad() {},
  methods: {
    details(item) {
      if (!item.route) {
        this.$refs.uToast.show({
          type: "default",
          message: "正在开发中",
        });
        return;
      }
      // 先清除在产页面等
      this.$ls.remove("xsdInformation");
      this.$ls.remove("cgdInformation");
      this.$ls.remove("thjsInformation");
      this.$ls.remove("khddInformation");
      this.$ls.remove("cgdreturnInformation");
      this.$ls.remove("dbdInformation");
      // 单独为调拨单创建数据结构
      const data = {
        supplier: item, // 调拨单数据
        productInformation: [], // 产品数据 { warehouse 仓库信息 , product : 产品信息}
      };
      this.$ls.set("dbdInformation", data);
      this.$Router.push({
        path: item.route,
      });
    },
  },
};
</script>

<style>
page {
  width: 100%;
  background-color: #ebebeb;
}
</style>
<style lang="scss" scoped>
@function realSize($args) {
  @return $args / 1.5;
}

.page_edu {
  width: 100%;
  background: rgba(255, 255, 255, 1);
  height: 100%;
}

.page_edu_header {
  padding-top: var(--status-bar-height);
  background: linear-gradient(to right, #409EFF, #60b4f6);
//   background: linear-gradient(
//     to left,
//     rgb(0, 164, 217),
//     rgb(0, 178, 206),
//     rgb(0, 191, 199),
//     rgb(2, 204, 188)
//   );
  width: 100%;
  height: realSize(415px);

  .header {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: realSize(20px);

    .input {
      height: realSize(59px);
      width: 100%;
      margin-left: realSize(20px);
      margin-right: realSize(20px);
      background: rgba(255, 255, 255, 1);
      border-radius: realSize(30px);
      display: flex;
      flex-direction: row;
      align-items: center;

      .search {
        width: realSize(30px);
        height: realSize(30px);
        margin-left: realSize(20px);
        margin-right: realSize(20px);
      }
    }
  }

  .header_content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    .left {
      display: flex;
      flex-direction: column;
      margin-top: 10px;
      margin-left: 15px;
      margin-right: 15px;

      .title {
        font-size: realSize(35px);
        font-weight: bold;
        color: rgba(255, 255, 255, 1);
      }

      .sub_title {
        margin-top: 3px;
        font-size: realSize(18px);
        font-weight: 400;
        color: rgba(255, 255, 255, 1);
        display: flex;
        align-items: center;
        background: linear-gradient(
          0deg,
          rgba(120, 255, 224, 1) 0%,
          rgba(255, 255, 255, 1) 100%
        );
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    }
  }
}

.page_content {
  width: 100%;
  .menu {
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 10px;
    padding-right: 10px;
    height: realSize(176px);
    // box-shadow: 0px 10px 10px 0px rgba(0, 161, 124, 0.1);
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;

    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      .img_view {
        width: 50px;
        height: 50px;
        border-radius: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .txt {
        margin-top: 5px;
        font-size: 12px;
        color: rgba(51, 51, 51, 1);
        font-weight: 600;
      }
    }
  }

  .s_menu {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    margin-top: 15px;
    margin-left: 10px;
    margin-right: 10px;
    padding-left: 10px;
    padding-right: 10px;

    .item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      .image {
        width: 35px;
        height: 35px;
      }

      .txt {
        margin-top: 5px;
        font-size: 14px;
        color: rgba(51, 51, 51, 1);
      }
    }
  }

  .ad {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    .bg {
      position: absolute;
      width: 120px;
      height: 105px;
      left: 0;
    }

    .ad_btn {
      width: 100%;
      height: 63px;
      margin: 30px;
      background: linear-gradient(
        0deg,
        rgba(253, 155, 28, 1),
        rgba(251, 197, 33, 1)
      );
      border-radius: 67px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      .title {
        font-size: realSize(38px);
        font-family: PingFang-SC-Heavy;
        font-weight: 800;
        color: rgba(255, 255, 255, 1);
      }

      .sub_title {
        background: linear-gradient(
          0deg,
          rgba(255, 128, 37, 1),
          rgba(255, 153, 32, 1)
        );
        box-shadow: 0px 4px 5px 0px rgba(92, 53, 48, 0.3),
          0px 1px 0px 0px rgba(228, 228, 228, 1);
        border-radius: realSize(24px);
        font-size: realSize(24px);
        font-family: PingFang-SC-Heavy;
        font-weight: 800;
        font-style: italic;
        color: rgba(255, 236, 177, 1);
        line-height: realSize(26px);
      }
    }
  }
}

.slider {
  white-space: nowrap;
  width: 100%;
  background-color: white;

  .item {
    display: inline-block;
    margin-left: 15px;
    margin-top: 13px;
    margin-bottom: 13px;
    width: 60%;
    height: 125px;
    border-radius: 10px;

    .item_content {
      display: flex;
      flex-direction: row;

      .title {
        width: 36%;
        margin: 20px;
        display: flex;
        flex-direction: column;

        .first {
          font-size: 16px;
          color: rgba(46, 65, 69, 1);
        }
        .main {
          font-size: 13px;
          color: rgba(79, 103, 101, 1);
          margin-top: 5px;
        }
        .sub {
          width: 60px;
          font-size: 10px;
          margin-top: 20px;
          background: rgba(255, 255, 255, 0.4);
          border-radius: 5px;
          display: flex;
          align-items: center;
          justify-content: center;
        }
      }

      .image {
        margin-top: 35px;
        width: 80px;
        height: 80px;
      }

      .free {
        background: rgba(11, 147, 252, 1);
        border-radius: 0px 0px 22px 22px;
        width: 25px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #ffffff;
        font-size: 14px;
      }
    }
  }
}
</style>
